//字体图标URL css
const cssCdnUrlList: Array<string> = [
    '//at.alicdn.com/t/c/font_4633480_2it7q1d9j1.css',
]
//第三方js URL
const jsCdnUrlList: Array<string> = []

//动态批量设置字体图标
export function setCssCdn() {
    if (cssCdnUrlList.length <= 0) return false
    cssCdnUrlList.map((v) => {
        let link = document.createElement('link')
        link.rel = 'stylesheet'
        link.href = v
        link.crossOrigin = 'anonymous'
        document.getElementsByTagName('head')[0].appendChild(link)
    })
}
//动态批量设置第三方js
export function setJsCdn() {
    if (jsCdnUrlList.length <= 0) return false
    jsCdnUrlList.map((v) => {
        let link = document.createElement('script')
        link.src = v
        document.body.appendChild(link)
    })
}
/**
 * 导出设置方法
 */
const setIntroduction = {
    cssCdn: () => {
        setCssCdn()
    },
    jsCdn: () => {
        setJsCdn()
    },
}
export default setIntroduction
